feat: advertise qdrant-dotnet in the User-Agent - #124
Merged
Conversation
The SDK previously set no Qdrant-branded User-Agent, so the only token on the wire was the gRPC library's own "grpc-dotnet/<version>". Server-side tooling (e.g. the Qdrant Cloud auth sidecars' client metrics) therefore could not attribute traffic to the .NET client. Grpc.Net.Client does not allow replacing the User-Agent through gRPC metadata, so a DelegatingHandler now adds a "qdrant-dotnet/<version>" token at the HTTP layer. The version is resolved from the assembly informational version (stamped by MinVer). The handler is wired into QdrantChannel.ForAddress for net6.0 and netstandard2.0; on .NET Framework, where the channel handler must be configured manually, the original behavior is preserved. Co-authored-by: Cursor <cursoragent@cursor.com>
Anush008
approved these changes
Jun 17, 2026
Anush008
left a comment
Member
There was a problem hiding this comment.
Pushed some simplification.
LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The .NET SDK currently sets no Qdrant-branded
User-Agent. The only token on the wire is the oneGrpc.Net.Clientinjects, e.g.:Because of that, server-side tooling cannot attribute traffic to the .NET client. Concretely, the Qdrant Cloud auth sidecars expose a
client_requests_total{client,version}metric resolved from theUser-Agent, and .NET requests land in theotherbucket instead ofdotnet.This PR makes the SDK advertise a
qdrant-dotnet/<version>token.Approach
Grpc.Net.Clientdoes not allow replacing theUser-Agentvia gRPC metadata (it only appends), so the token is added at the HTTP layer with a smallDelegatingHandler(UserAgentHandler) wired intoQdrantChannel.ForAddress. The resulting header looks like:+<sha>) stripped.net6.0/netstandard2.0. On .NET Framework (net462), where the channel's HTTP handler must be configured manually (WinHttpHandler, per the README), the original behavior is preserved to avoid disturbing the finicky HTTP/2 setup.Tests
Added
UserAgentHandlerTests(pure unit tests, no Qdrant server needed):qdrant-dotnet/<version>tokengrpc-dotnettokenNotes
net8.0test run +net462/net6.0/netstandard2.0build) to validate.Made with Cursor